import { createStore } from 'vuex'

import user from '@/store/user'
import cart from '@/store/cart'
import cate from '@/store/cate'
import global from '@/store/global'

import createPersistedstate from 'vuex-persistedstate'
export default createStore({

  // 全局注册
  ...global,
  // 局部注册
  modules: {
    user,
    cart,
    cate
  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store',
      paths: ['user', 'cart']
    })
  ]
})
